<?xml version="1.0" encoding="UTF-8"?>
<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets" 
      xmlns:c="http://java.sun.com/jsp/jstl/core"
      xmlns:totoland="http://java.sun.com/jsf/composite/components">
    <h:head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <link href="${request.contextPath}/resources/images/favicon.ico" rel="shortcut icon" type="image/x-icon" />
            <script src="${request.contextPath}/resources/js/html5.js"></script>
        <link rel="stylesheet" href="${request.contextPath}/resources/css/style.css" media="screen"/>
        
        <link rel="stylesheet" href="${request.contextPath}/resources/css/style.responsive.css" media="all"/>

    </h:head>
    <h:body id="body011">
        <p:blockUI block="body011"  widgetVar="blogui011">
            LOADING<br />
            <img src="${request.contextPath}/resources/images/preloader-01.gif"/>
        </p:blockUI>
        <p:ajaxStatus onstart="blogui011.show()" oncomplete="blogui011.hide()"/>
        <h:form>

            <p:panel id="REPORT_011" header="#{msg.report_011_header}">

                <p:panel header="#{formReport011Controller.reportTitle}">


                    <p:messages id="REPORT_011msgFrmDetails"></p:messages>

                    <script>
                        //<![CDATA[
                        function disabledInput(flag) {
                            var input = document.getElementsByTagName("input");

                            for (var i = 0; i < input.length; i++) {
                                input[i].style.display = flag == true ? 'none' : '';
                            }
                        }
                        //]]>
                    </script>

                    <p:remoteCommand name="calSum" update="REPORT_011pnlFrm" onstart="disabledInput(true)" oncomplete="disabledInput(false)" actionListener="#{formReport011Controller.calSum()}">
                    </p:remoteCommand>

                    <p:panelGrid styleClass="frmDetail" id="REPORT_011pnlFrm" style="text-align: center;vertical-align: middle">
                        <f:facet name="header">
                            <p:row>  
                                <p:column rowspan="2" style="text-align: center;vertical-align: middle;width: 200px">ประเภทการเลือกตั้ง</p:column>
                                <p:column rowspan="2" style="text-align: center;vertical-align: middle;width: 90px">ทั้งหมด (เรื่อง) (1)</p:column>
                                <p:column rowspan="2" style="text-align: center;vertical-align: middle;width: 90px">อยู่ส่วนกลาง (เรื่อง) (2)</p:column>
                                <p:column rowspan="2" style="text-align: center;vertical-align: middle;width: 90px">อยู่ที่ สนง. กกต.จว. (เรื่อง) (3)</p:column>
                                <p:column rowspan="2" style="text-align: center;vertical-align: middle;width: 90px">กกต. มีมติแล้ว (เรื่อง) (4)</p:column>
                                <p:column colspan="4" style="text-align: center;">สถานะเรื่องค้างที่ส่วนกลาง (เรื่อง)</p:column>
                            </p:row>
                            <p:row>
                                <p:column colspan="1" style="text-align: center;width: 90px">จนท. วิเคราะห์ (5)</p:column>
                                <p:column colspan="1" style="text-align: center;width: 90px">เสนอ ลธ.กกต. (6)</p:column>
                                <p:column colspan="1" style="text-align: center;width: 90px">เข้าคณะอนุฯ (7)</p:column>
                                <p:column colspan="1" style="text-align: center;width: 90px">อยู่ในวาระ (8)</p:column>
                            </p:row>
                        </f:facet>
                        <p:row>
                            <p:column>
                                <p:autoComplete disabled="#{formReport011Controller.paramMode=='view'}"  dropdown="true" value="#{formReport011Controller.report011Details[0].institution}" 
                                                completeMethod="#{formReport011Controller.dropdownFactory.listDntSelection()}"/>
                            </p:column>
                            <p:column>
                                <h:outputText value="#{formReport011Controller.report011Details[0].allamount}"/>
                            </p:column>
                            <p:column>
                                <h:outputText value="#{formReport011Controller.report011Details[0].atCenter}"/>
                            </p:column>
                            <p:column>
                                <totoland:inputNumber onchange="calSum()" disabled="#{formReport011Controller.paramMode=='view'}"  value="#{formReport011Controller.report011Details[0].atEctProvince}">

                                </totoland:inputNumber>
                            </p:column>
                            <p:column>
                                <totoland:inputNumber onchange="calSum()" disabled="#{formReport011Controller.paramMode=='view'}"  value="#{formReport011Controller.report011Details[0].ectResolve}">

                                </totoland:inputNumber>
                            </p:column>
                            <p:column>
                                <totoland:inputNumber onchange="calSum()" disabled="#{formReport011Controller.paramMode=='view'}"  value="#{formReport011Controller.report011Details[0].analystRemain}">

                                </totoland:inputNumber>
                            </p:column>
                            <p:column>
                                <totoland:inputNumber onchange="calSum()" disabled="#{formReport011Controller.paramMode=='view'}"  value="#{formReport011Controller.report011Details[0].offerEct}">

                                </totoland:inputNumber>
                            </p:column>
                            <p:column>
                                <totoland:inputNumber onchange="calSum()" disabled="#{formReport011Controller.paramMode=='view'}"  value="#{formReport011Controller.report011Details[0].accessCommittee}">

                                </totoland:inputNumber>
                            </p:column>
                            <p:column>
                                <totoland:inputNumber onchange="calSum()" disabled="#{formReport011Controller.paramMode=='view'}"  value="#{formReport011Controller.report011Details[0].onAgenda}">

                                </totoland:inputNumber>
                            </p:column>
                        </p:row>
                        <p:row>
                            <p:column>
                                <p:autoComplete disabled="#{formReport011Controller.paramMode=='view'}"   dropdown="true" value="#{formReport011Controller.report011Details[1].institution}" 
                                                completeMethod="#{formReport011Controller.dropdownFactory.listDntSelection()}"/>
                            </p:column>
                            <p:column>
                                <h:outputText value="#{formReport011Controller.report011Details[1].allamount}"/>
                            </p:column>
                            <p:column>
                                <h:outputText value="#{formReport011Controller.report011Details[1].atCenter}"/>
                            </p:column>
                            <p:column>
                                <totoland:inputNumber onchange="calSum()" disabled="#{formReport011Controller.paramMode=='view'}"  value="#{formReport011Controller.report011Details[1].atEctProvince}">

                                </totoland:inputNumber>
                            </p:column>
                            <p:column>
                                <totoland:inputNumber onchange="calSum()" disabled="#{formReport011Controller.paramMode=='view'}"  value="#{formReport011Controller.report011Details[1].ectResolve}">

                                </totoland:inputNumber>
                            </p:column>
                            <p:column>
                                <totoland:inputNumber onchange="calSum()" disabled="#{formReport011Controller.paramMode=='view'}"  value="#{formReport011Controller.report011Details[1].analystRemain}">

                                </totoland:inputNumber>
                            </p:column>
                            <p:column>
                                <totoland:inputNumber onchange="calSum()" disabled="#{formReport011Controller.paramMode=='view'}"  value="#{formReport011Controller.report011Details[1].offerEct}">

                                </totoland:inputNumber>
                            </p:column>
                            <p:column>
                                <totoland:inputNumber onchange="calSum()" disabled="#{formReport011Controller.paramMode=='view'}"  value="#{formReport011Controller.report011Details[1].accessCommittee}">

                                </totoland:inputNumber>
                            </p:column>
                            <p:column>
                                <totoland:inputNumber onchange="calSum()" disabled="#{formReport011Controller.paramMode=='view'}"  value="#{formReport011Controller.report011Details[1].onAgenda}">

                                </totoland:inputNumber>
                            </p:column>
                        </p:row>
                        <p:row>
                            <p:column>
                                <p:autoComplete disabled="#{formReport011Controller.paramMode=='view'}"   dropdown="true" value="#{formReport011Controller.report011Details[2].institution}" 
                                                completeMethod="#{formReport011Controller.dropdownFactory.listDntSelection()}"/>
                            </p:column>
                            <p:column>
                                <h:outputText value="#{formReport011Controller.report011Details[2].allamount}"/>
                            </p:column>
                            <p:column>
                                <h:outputText value="#{formReport011Controller.report011Details[2].atCenter}"/>
                            </p:column>
                            <p:column>
                                <totoland:inputNumber onchange="calSum()" disabled="#{formReport011Controller.paramMode=='view'}"  value="#{formReport011Controller.report011Details[2].atEctProvince}">

                                </totoland:inputNumber>
                            </p:column>
                            <p:column>
                                <totoland:inputNumber onchange="calSum()" disabled="#{formReport011Controller.paramMode=='view'}"  value="#{formReport011Controller.report011Details[2].ectResolve}">

                                </totoland:inputNumber>
                            </p:column>
                            <p:column>
                                <totoland:inputNumber onchange="calSum()" disabled="#{formReport011Controller.paramMode=='view'}"  value="#{formReport011Controller.report011Details[2].analystRemain}">

                                </totoland:inputNumber>
                            </p:column>
                            <p:column>
                                <totoland:inputNumber onchange="calSum()" disabled="#{formReport011Controller.paramMode=='view'}"  value="#{formReport011Controller.report011Details[2].offerEct}">

                                </totoland:inputNumber>
                            </p:column>
                            <p:column>
                                <totoland:inputNumber onchange="calSum()" disabled="#{formReport011Controller.paramMode=='view'}"  value="#{formReport011Controller.report011Details[2].accessCommittee}">

                                </totoland:inputNumber>
                            </p:column>
                            <p:column>
                                <totoland:inputNumber onchange="calSum()" disabled="#{formReport011Controller.paramMode=='view'}"  value="#{formReport011Controller.report011Details[2].onAgenda}">

                                </totoland:inputNumber>
                            </p:column>
                        </p:row>
                        <p:row>
                            <p:column>
                                <p:autoComplete disabled="#{formReport011Controller.paramMode=='view'}"   dropdown="true" value="#{formReport011Controller.report011Details[3].institution}" 
                                                completeMethod="#{formReport011Controller.dropdownFactory.listDntSelection()}"/>
                            </p:column>
                            <p:column>
                                <h:outputText value="#{formReport011Controller.report011Details[3].allamount}"/>
                            </p:column>
                            <p:column>
                                <h:outputText value="#{formReport011Controller.report011Details[3].atCenter}"/>
                            </p:column>
                            <p:column>
                                <totoland:inputNumber onchange="calSum()" disabled="#{formReport011Controller.paramMode=='view'}"  value="#{formReport011Controller.report011Details[3].atEctProvince}">

                                </totoland:inputNumber>
                            </p:column>
                            <p:column>
                                <totoland:inputNumber onchange="calSum()" disabled="#{formReport011Controller.paramMode=='view'}"  value="#{formReport011Controller.report011Details[3].ectResolve}">

                                </totoland:inputNumber>
                            </p:column>
                            <p:column>
                                <totoland:inputNumber onchange="calSum()" disabled="#{formReport011Controller.paramMode=='view'}"  value="#{formReport011Controller.report011Details[3].analystRemain}">

                                </totoland:inputNumber>
                            </p:column>
                            <p:column>
                                <totoland:inputNumber onchange="calSum()" disabled="#{formReport011Controller.paramMode=='view'}"  value="#{formReport011Controller.report011Details[3].offerEct}">

                                </totoland:inputNumber>
                            </p:column>
                            <p:column>
                                <totoland:inputNumber onchange="calSum()" disabled="#{formReport011Controller.paramMode=='view'}"  value="#{formReport011Controller.report011Details[3].accessCommittee}">

                                </totoland:inputNumber>
                            </p:column>
                            <p:column>
                                <totoland:inputNumber onchange="calSum()" disabled="#{formReport011Controller.paramMode=='view'}"  value="#{formReport011Controller.report011Details[3].onAgenda}">

                                </totoland:inputNumber>
                            </p:column>
                        </p:row>
                        <p:row>
                            <p:column>
                                <p:autoComplete disabled="#{formReport011Controller.paramMode=='view'}"   dropdown="true" value="#{formReport011Controller.report011Details[4].institution}" 
                                                completeMethod="#{formReport011Controller.dropdownFactory.listDntSelection()}"/>
                            </p:column>
                            <p:column>
                                <h:outputText value="#{formReport011Controller.report011Details[4].allamount}"/>
                            </p:column>
                            <p:column>
                                <h:outputText value="#{formReport011Controller.report011Details[4].atCenter}"/>
                            </p:column>
                            <p:column>
                                <totoland:inputNumber onchange="calSum()" disabled="#{formReport011Controller.paramMode=='view'}"  value="#{formReport011Controller.report011Details[4].atEctProvince}">

                                </totoland:inputNumber>
                            </p:column>
                            <p:column>
                                <totoland:inputNumber onchange="calSum()" disabled="#{formReport011Controller.paramMode=='view'}"  value="#{formReport011Controller.report011Details[4].ectResolve}">

                                </totoland:inputNumber>
                            </p:column>
                            <p:column>
                                <totoland:inputNumber onchange="calSum()" disabled="#{formReport011Controller.paramMode=='view'}"  value="#{formReport011Controller.report011Details[4].analystRemain}">

                                </totoland:inputNumber>
                            </p:column>
                            <p:column>
                                <totoland:inputNumber onchange="calSum()" disabled="#{formReport011Controller.paramMode=='view'}"  value="#{formReport011Controller.report011Details[4].offerEct}">

                                </totoland:inputNumber>
                            </p:column>
                            <p:column>
                                <totoland:inputNumber onchange="calSum()" disabled="#{formReport011Controller.paramMode=='view'}"  value="#{formReport011Controller.report011Details[4].accessCommittee}">

                                </totoland:inputNumber>
                            </p:column>
                            <p:column>
                                <totoland:inputNumber onchange="calSum()" disabled="#{formReport011Controller.paramMode=='view'}"  value="#{formReport011Controller.report011Details[4].onAgenda}">

                                </totoland:inputNumber>
                            </p:column>
                        </p:row>
                        <p:row>
                            <p:column>
                                <h:outputText value="รวม"/>
                            </p:column>
                            <p:column>
                                <h:outputText value="#{formReport011Controller.sumDetail.allamount}"/>
                            </p:column>
                            <p:column>
                                <h:outputText value="#{formReport011Controller.sumDetail.atCenter}"/>
                            </p:column>
                            <p:column>
                                <h:outputText    value="#{formReport011Controller.sumDetail.atEctProvince}">

                                </h:outputText>
                            </p:column>
                            <p:column>
                                <h:outputText    value="#{formReport011Controller.sumDetail.ectResolve}">

                                </h:outputText>
                            </p:column>
                            <p:column>
                                <h:outputText    value="#{formReport011Controller.sumDetail.analystRemain}">

                                </h:outputText>
                            </p:column>
                            <p:column>
                                <h:outputText    value="#{formReport011Controller.sumDetail.offerEct}">

                                </h:outputText>
                            </p:column>
                            <p:column>
                                <h:outputText    value="#{formReport011Controller.sumDetail.accessCommittee}">

                                </h:outputText>
                            </p:column>
                            <p:column>
                                <h:outputText    value="#{formReport011Controller.sumDetail.onAgenda}">

                                </h:outputText>
                            </p:column>
                        </p:row>

                    </p:panelGrid>
                    <h:panelGroup id="REPORT_011pnlCmd" rendered="#{formReport011Controller.report011.flowStatusId!=200}">
                        <div align="center">
                            <p:commandButton value="#{msg.btn_save}" actionListener="#{formReport011Controller.save()}" id="REPORT_011btnSave" rendered="#{formReport011Controller.paramMode=='create'}"/>
                            <p:commandButton value="#{msg.btn_edit}" actionListener="#{formReport011Controller.goToEdit()}" id="REPORT_011btnEdit" rendered="#{formReport011Controller.paramMode=='view' 
                                                      and formReport011Controller.canEdit(formReport011Controller.report011.createdUserGroup,formReport011Controller.report011.reportStatus,formReport011Controller.report011.flowStatusId)}"/>
                            <p:commandButton value="#{msg.btn_close}" actionListener="#{formReport011Controller.goToClose()}" id="REPORT_011btnClose" rendered="#{formReport011Controller.paramMode=='view' || formReport011Controller.paramMode=='create'}"/>
                            <p:commandButton value="#{msg.btn_save}" actionListener="#{formReport011Controller.edit()}" id="REPORT_011btnSaveEdit" rendered="#{formReport011Controller.paramMode=='edit'}"/>
                            <p:commandButton value="#{msg.btn_cancel}" id="REPORT_011btnCancel" actionListener="#{formReport011Controller.goToCancel()}" rendered="#{formReport011Controller.paramMode=='edit'}"/>
                        </div>
                    </h:panelGroup>
                </p:panel>

            </p:panel>
        </h:form>
        <style>
            input[type="text"] {
                clear: left;
                cursor: text;
                list-style-type: none;
                margin: 0;
                min-height: 1px;
                overflow: hidden;
                width: 90px;
            }
        </style>
    </h:body>
</html>